package com.ljxy.score.controller.myController;
import com.baomidou.mybatisplus.extension.api.R;
import com.ljxy.score.util.ExcelUtil;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
@CrossOrigin
@RestController
@RequestMapping("/excel")
public class ExcelController {
    @Resource
    private com.ljxy.score.service.mystudentService mystudentService;

    @Resource
    private com.ljxy.score.service.myscoreService myscoreService;

    @PostMapping("/import_excel")
    public R<?> upload(@RequestParam("file") MultipartFile file) throws IOException {
        ExcelUtil.upload(myscoreService, mystudentService, file);
        return R.ok("");
    }
}
